import Vue from 'vue'
import VueRouter from 'vue-router'
// import Home from '../views/Home.vue'
import recommend from '../views/recommend.vue'

Vue.use(VueRouter)

const routes = [
  {
    path:"/",
    redirect:"/recommend"
  },
  //首页
  {
    path:"/recommend",
    name:"recommend",
    component:recommend
  },
  //分类
  {
    path:"/classify",
    name:"classify",
    component:()=>import("../views/classify.vue")
  },
  //免费
  {
    path:"/free",
    name:"free",
    component:()=>import("../views/free.vue")
  },
  //书架 bookshelf
  {
    path:"/bookshelf",
    name:"bookshelf",
    component:()=>import("../views/bookshelf.vue")
  },
  //我的
  {
    path:"/my",
    name:"my",
    component:()=>import("../views/my.vue")
  },
  //搜索
  {
    path:"/search",
    name:"search",
    component:()=>import("../views/search.vue")
  },
  //书籍详情
  {
    path:"/bookxq",
    name:"bookxq",
    component:()=>import("../components/book/bookxq.vue")
  },
  //翻页页面
  {
    path:"/bookpages",
    name:"bookpages",
    component:()=>import("../components/book/bookpages.vue")
  },
  //分类小说页面
  //sortbook
  {
    path:"/sortbook",
    name:"sortbook",
    component:()=>import("../components/book/sortbook.vue")
  },
  //登录
  {
    path:"/login",
    name:"login",
    component:()=>import("../components/base/login.vue")
  },
  //消息
  {
    path:"/message",
    name:"message",
    component:()=>import("../components/base/message.vue")
  },
  //上传
  {
    path:"/upload",
    name:"upload",
    component:()=>import("../components/base/upload")
  },
  //笔记
  {
    path:"/note",
    name:"note",
    component:()=>import("../components/base/note")
  },
  //积分
  {
    path:"/integral",
    name:"integral",
    component:()=>import("../components/base/integral")
  },
  //完整榜单
  {
    path:"/complete",
    name:"complete",
    component:()=>import("../components/base/complete")
  },
  // {
  //   path: '/',
  //   name: 'Home',
  //   component: Home
  // },
  // {
  //   path: '/about',
  //   name: 'About',
  //   // route level code-splitting
  //   // this generates a separate chunk (about.[hash].js) for this route
  //   // which is lazy-loaded when the route is visited.
  //   component: () => import(/* webpackChunkName: "about" */ '../views/About.vue')
  // }
]

const router = new VueRouter({
  base: process.env.BASE_URL,
  routes
})

export default router
